From: Florian Müllner Date: Mon, 3 Aug 2020 16:33:57 +0000 (+0200) Subject: environment: Mark transitions as "work" X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~40 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cf1d09b482b4549d05955734b9fc5668c270d168;p=gnome-shell.git environment: Mark transitions as "work" global.run_at_leisure() is used from automated scripts to schedule a callback when the shell is idle. However since we moved away from Tweener, animations are no longer taken into account; fix this by marking transitions as "work" if the convenience ease() functions are used. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396 --- diff --git a/js/ui/environment.js b/js/ui/environment.js index 9b4ef24b1..af0300dc7 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -134,7 +134,14 @@ function _easeActor(actor, params) { actor.set_easing_mode(params.mode); delete params.mode; - let cleanup = () => Meta.enable_unredirect_for_display(global.display); + const prepare = () => { + Meta.disable_unredirect_for_display(global.display); + global.begin_work(); + }; + const cleanup = () => { + Meta.enable_unredirect_for_display(global.display); + global.end_work(); + }; let callback = _makeEaseCallback(params, cleanup); // cancel overwritten transitions @@ -149,9 +156,9 @@ function _easeActor(actor, params) { .find(t => t !== null); if (transition && transition.delay) - transition.connect('started', () => Meta.disable_unredirect_for_display(global.display)); + transition.connect('started', () => prepare()); else - Meta.disable_unredirect_for_display(global.display); + prepare(); if (transition) { transition.set({ repeatCount, autoReverse }); @@ -191,7 +198,14 @@ function _easeActorProperty(actor, propName, target, params) { if (actor instanceof Clutter.Actor && !actor.mapped) duration = 0; - let cleanup = () => Meta.enable_unredirect_for_display(global.display); + const prepare = () => { + Meta.disable_unredirect_for_display(global.display); + global.begin_work(); + }; + const cleanup = () => { + Meta.enable_unredirect_for_display(global.display); + global.end_work(); + }; let callback = _makeEaseCallback(params, cleanup); // cancel overwritten transition @@ -203,7 +217,7 @@ function _easeActorProperty(actor, propName, target, params) { if (!isReversed) obj[prop] = target; - Meta.disable_unredirect_for_display(global.display); + prepare(); callback(true); return; @@ -222,9 +236,9 @@ function _easeActorProperty(actor, propName, target, params) { transition.set_to(target); if (transition.delay) - transition.connect('started', () => Meta.disable_unredirect_for_display(global.display)); + transition.connect('started', () => prepare()); else - Meta.disable_unredirect_for_display(global.display); + prepare(); transition.connect('stopped', (t, finished) => callback(finished)); }